﻿/*
==================================================================
    注意：此文件为Auto代码，不可手动修改【在用绳档案】
==================================================================
*/

namespace Services
{
    /// <summary>
    /// Auto在用绳档案
    /// </summary>
    public abstract class AutoUsingWireropeMapping : BaseMapping<UsingWirerope, UsingWireropeModel, UsingWireropeFilterModel>
    {
        public AutoUsingWireropeMapping(ICurrentUser currentUser)
            : base(currentUser) { }

        #region 读数据
        /// <summary>
        /// 读数据，从Entity对象转成Model对象
        /// </summary>
        /// <param name="entity">Entity对象</param>
        /// <returns></returns>
        public override UsingWireropeModel Entity2Model(UsingWirerope entity)
        {
            UsingWireropeModel model = new UsingWireropeModel();

            model.UsingWireropeID = entity.UsingWireropeID;
            model.GroupInfoID = entity.GroupInfoID;
            model.StockID = entity.StockID;
            model.Code = entity.Code;
            model.GuiGe = entity.GuiGe;
            model.Diameter = entity.Diameter;
            model.Cnt = entity.Cnt;
            model.Name = entity.Name;
            model.NianJu = entity.NianJu;
            model.MpaID = entity.MpaID;
            model.MpaName = entity.MpaName;
            model.SurfaceStatusID = entity.SurfaceStatusID;
            model.SurfaceStatusName = entity.SurfaceStatusName;
            model.TwistingTypeID = entity.TwistingTypeID;
            model.TwistingTypeName = entity.TwistingTypeName;
            model.LengthNum = entity.LengthNum;
            model.SupplierID = entity.SupplierID;
            model.SupplierName = entity.SupplierName;
            model.ProducerID = entity.ProducerID;
            model.ProducerName = entity.ProducerName;
            model.DepartmentID = entity.DepartmentID;
            model.HoisterID = entity.HoisterID;
            model.HoisterName = entity.HoisterName;
            model.HoisterUsageID = entity.HoisterUsageID;
            model.HoisterUsageName = entity.HoisterUsageName;
            model.WireropeTypeID = entity.WireropeTypeID;
            model.WireropeTypeName = entity.WireropeTypeName;
            model.ChuChang_FilesList = entity.ChuChang_Files.GetFileList();
            model.YanShou_FilesList = entity.YanShou_Files.GetFileList();
            model.JianCe_FilesList = entity.JianCe_Files.GetFileList();
            model.Attr_FilesList = entity.Attr_Files.GetFileList();
            model.InstallDate = entity.InstallDate;
            model.InstallLengthNum = entity.InstallLengthNum;
            model.InstallAddressID = entity.InstallAddressID;
            model.InstallAddressName = entity.InstallAddressName;
            model.LinkUser = entity.LinkUser;
            model.LinkPhone = entity.LinkPhone;
            model.Remark = entity.Remark;
            model.LaNiu_FilesList = entity.LaNiu_Files.GetFileList();
            model.QianWuSun_FilesList = entity.QianWuSun_Files.GetFileList();
            model.HouWuSun_FilesList = entity.HouWuSun_Files.GetFileList();
            model.OutStockDate = entity.OutStockDate;
            model.NextCheckDate = entity.NextCheckDate;
            model.Status = entity.Status;
            model.ChangeReason = entity.ChangeReason;
            model.ChangeDate = entity.ChangeDate;
            model.OriginKn = entity.OriginKn;
            model.MinKn = entity.MinKn;
            model.MinKnPercent = entity.MinKnPercent;
            model.Attr1_FilesList = entity.Attr1_Files.GetFileList();
            model.Attr2_FilesList = entity.Attr2_Files.GetFileList();
            model.Attr3_FilesList = entity.Attr3_Files.GetFileList();
            model.Attr4_FilesList = entity.Attr4_Files.GetFileList();
            model.VideoUrl = entity.VideoUrl;
            model.CreateUserID = entity.CreateUserID;
            model.CreateUserName = entity.CreateUserName;
            model.CreateDate = entity.CreateDate;
            model.UpdateUserID = entity.UpdateUserID;
            model.UpdateUserName = entity.UpdateUserName;
            model.UpdateDate = entity.UpdateDate;

            return model;
        }
        #endregion

        #region 写数据
        /// <summary>
        /// 写数据，从Model对象转换成Entity对象
        /// </summary>
        /// <param name="model">ViewModel对象</param>
        /// <returns></returns>
        public override UsingWirerope Model2Entity(UsingWireropeModel model)
        {
            UsingWirerope entity = new UsingWirerope();

            entity.UsingWireropeID = model.UsingWireropeID;
            entity.GroupInfoID = model.GroupInfoID;
            entity.StockID = model.StockID;
            entity.Code = model.Code;
            entity.GuiGe = model.GuiGe;
            entity.Diameter = model.Diameter;
            entity.Cnt = model.Cnt;
            entity.Name = model.Name;
            entity.NianJu = model.NianJu;
            entity.MpaID = model.MpaID;
            entity.MpaName = model.MpaName;
            entity.SurfaceStatusID = model.SurfaceStatusID;
            entity.SurfaceStatusName = model.SurfaceStatusName;
            entity.TwistingTypeID = model.TwistingTypeID;
            entity.TwistingTypeName = model.TwistingTypeName;
            entity.LengthNum = model.LengthNum;
            entity.SupplierID = model.SupplierID;
            entity.SupplierName = model.SupplierName;
            entity.ProducerID = model.ProducerID;
            entity.ProducerName = model.ProducerName;
            entity.DepartmentID = model.DepartmentID;
            entity.HoisterID = model.HoisterID;
            entity.HoisterName = model.HoisterName;
            entity.HoisterUsageID = model.HoisterUsageID;
            entity.HoisterUsageName = model.HoisterUsageName;
            entity.WireropeTypeID = model.WireropeTypeID;
            entity.WireropeTypeName = model.WireropeTypeName;
            entity.ChuChang_Files = model.ChuChang_FilesList.GetFileString();
            entity.YanShou_Files = model.YanShou_FilesList.GetFileString();
            entity.JianCe_Files = model.JianCe_FilesList.GetFileString();
            entity.Attr_Files = model.Attr_FilesList.GetFileString();
            entity.InstallDate = model.InstallDate;
            entity.InstallLengthNum = model.InstallLengthNum;
            entity.InstallAddressID = model.InstallAddressID;
            entity.InstallAddressName = model.InstallAddressName;
            entity.LinkUser = model.LinkUser;
            entity.LinkPhone = model.LinkPhone;
            entity.Remark = model.Remark;
            entity.LaNiu_Files = model.LaNiu_FilesList.GetFileString();
            entity.QianWuSun_Files = model.QianWuSun_FilesList.GetFileString();
            entity.HouWuSun_Files = model.HouWuSun_FilesList.GetFileString();
            entity.OutStockDate = model.OutStockDate;
            entity.NextCheckDate = model.NextCheckDate;
            entity.Status = model.Status;
            entity.ChangeReason = model.ChangeReason;
            entity.ChangeDate = model.ChangeDate;
            entity.OriginKn = model.OriginKn;
            entity.MinKn = model.MinKn;
            entity.MinKnPercent = model.MinKnPercent;
            entity.Attr1_Files = model.Attr1_FilesList.GetFileString();
            entity.Attr2_Files = model.Attr2_FilesList.GetFileString();
            entity.Attr3_Files = model.Attr3_FilesList.GetFileString();
            entity.Attr4_Files = model.Attr4_FilesList.GetFileString();
            entity.VideoUrl = model.VideoUrl;
            entity.CreateUserID = model.CreateUserID;
            entity.CreateUserName = model.CreateUserName;
            entity.CreateDate = model.CreateDate;
            entity.UpdateUserID = model.UpdateUserID;
            entity.UpdateUserName = model.UpdateUserName;
            entity.UpdateDate = model.UpdateDate;

            return entity;
        }
        #endregion

        #region 搜索条件转换
        /// <summary>
        /// 搜索条件转换，从FilterModel对象转换成Where对象
        /// </summary>
        /// <param name="filterModel">FilterModel对象</param>
        /// <returns></returns>
        public override Expressionable<UsingWirerope> FilterModel2Where(UsingWireropeFilterModel filterModel)
        {
            var where = base.FilterModel2Where(filterModel);

            //编号
            if (filterModel._UsingWireropeID.HasValue)
            {
                where = where.And(x => x.UsingWireropeID == filterModel._UsingWireropeID.Value);
            }
            if (filterModel._UsingWireropeIDs.IsNotEmpty() && filterModel._UsingWireropeIDs.Count > 0)
            {
                where = where.And(x => filterModel._UsingWireropeIDs.Contains(x.UsingWireropeID));
            }
            if (filterModel._NotUsingWireropeIDs.IsNotEmpty() && filterModel._NotUsingWireropeIDs.Count > 0)
            {
                where = where.And(x => !filterModel._NotUsingWireropeIDs.Contains(x.UsingWireropeID));
            }

            //集团
            if (filterModel._GroupInfoID.HasValue)
            {
                where = where.And(x => x.GroupInfoID == filterModel._GroupInfoID.Value);
            }
            if (filterModel._GroupInfoIDs.IsNotEmpty() && filterModel._GroupInfoIDs.Count > 0)
            {
                where = where.And(x => filterModel._GroupInfoIDs.Contains(x.GroupInfoID));
            }
            if (filterModel._NotGroupInfoIDs.IsNotEmpty() && filterModel._NotGroupInfoIDs.Count > 0)
            {
                where = where.And(x => !filterModel._NotGroupInfoIDs.Contains(x.GroupInfoID));
            }

            //库存钢丝绳
            if (filterModel._StockID.HasValue)
            {
                where = where.And(x => x.StockID == filterModel._StockID.Value);
            }
            if (filterModel._StockIDs.IsNotEmpty() && filterModel._StockIDs.Count > 0)
            {
                where = where.And(x => x.StockID.HasValue && filterModel._StockIDs.Contains(x.StockID.Value));
            }
            if (filterModel._NotStockIDs.IsNotEmpty() && filterModel._NotStockIDs.Count > 0)
            {
                where = where.And(x => x.StockID.HasValue && !filterModel._NotStockIDs.Contains(x.StockID.Value));
            }

            //编码
            if (!string.IsNullOrEmpty(filterModel._Code))
            {
                where = where.And(x => x.Code.Contains(filterModel._Code));
            }
            if (!string.IsNullOrEmpty(filterModel._CodeEqual))
            {
                where = where.And(x => x.Code == filterModel._CodeEqual);
            }

            //钢丝绳名称
            if (!string.IsNullOrEmpty(filterModel._Name))
            {
                where = where.And(x => x.Name.Contains(filterModel._Name));
            }
            if (!string.IsNullOrEmpty(filterModel._NameEqual))
            {
                where = where.And(x => x.Name == filterModel._NameEqual);
            }

            //抗拉强度
            if (filterModel._MpaID.HasValue)
            {
                where = where.And(x => x.MpaID == filterModel._MpaID.Value);
            }
            if (filterModel._MpaIDs.IsNotEmpty() && filterModel._MpaIDs.Count > 0)
            {
                where = where.And(x => x.MpaID.HasValue && filterModel._MpaIDs.Contains(x.MpaID.Value));
            }
            if (filterModel._NotMpaIDs.IsNotEmpty() && filterModel._NotMpaIDs.Count > 0)
            {
                where = where.And(x => x.MpaID.HasValue && !filterModel._NotMpaIDs.Contains(x.MpaID.Value));
            }

            //抗拉强度名称
            if (!string.IsNullOrEmpty(filterModel._MpaName))
            {
                where = where.And(x => x.MpaName.Contains(filterModel._MpaName));
            }
            if (!string.IsNullOrEmpty(filterModel._MpaNameEqual))
            {
                where = where.And(x => x.MpaName == filterModel._MpaNameEqual);
            }

            //表面状态
            if (filterModel._SurfaceStatusID.HasValue)
            {
                where = where.And(x => x.SurfaceStatusID == filterModel._SurfaceStatusID.Value);
            }
            if (filterModel._SurfaceStatusIDs.IsNotEmpty() && filterModel._SurfaceStatusIDs.Count > 0)
            {
                where = where.And(x => x.SurfaceStatusID.HasValue && filterModel._SurfaceStatusIDs.Contains(x.SurfaceStatusID.Value));
            }
            if (filterModel._NotSurfaceStatusIDs.IsNotEmpty() && filterModel._NotSurfaceStatusIDs.Count > 0)
            {
                where = where.And(x => x.SurfaceStatusID.HasValue && !filterModel._NotSurfaceStatusIDs.Contains(x.SurfaceStatusID.Value));
            }

            //表面状态名称
            if (!string.IsNullOrEmpty(filterModel._SurfaceStatusName))
            {
                where = where.And(x => x.SurfaceStatusName.Contains(filterModel._SurfaceStatusName));
            }
            if (!string.IsNullOrEmpty(filterModel._SurfaceStatusNameEqual))
            {
                where = where.And(x => x.SurfaceStatusName == filterModel._SurfaceStatusNameEqual);
            }

            //捻制类型
            if (filterModel._TwistingTypeID.HasValue)
            {
                where = where.And(x => x.TwistingTypeID == filterModel._TwistingTypeID.Value);
            }
            if (filterModel._TwistingTypeIDs.IsNotEmpty() && filterModel._TwistingTypeIDs.Count > 0)
            {
                where = where.And(x => x.TwistingTypeID.HasValue && filterModel._TwistingTypeIDs.Contains(x.TwistingTypeID.Value));
            }
            if (filterModel._NotTwistingTypeIDs.IsNotEmpty() && filterModel._NotTwistingTypeIDs.Count > 0)
            {
                where = where.And(x => x.TwistingTypeID.HasValue && !filterModel._NotTwistingTypeIDs.Contains(x.TwistingTypeID.Value));
            }

            //捻制类型名称
            if (!string.IsNullOrEmpty(filterModel._TwistingTypeName))
            {
                where = where.And(x => x.TwistingTypeName.Contains(filterModel._TwistingTypeName));
            }
            if (!string.IsNullOrEmpty(filterModel._TwistingTypeNameEqual))
            {
                where = where.And(x => x.TwistingTypeName == filterModel._TwistingTypeNameEqual);
            }

            //供应商
            if (filterModel._SupplierID.HasValue)
            {
                where = where.And(x => x.SupplierID == filterModel._SupplierID.Value);
            }
            if (filterModel._SupplierIDs.IsNotEmpty() && filterModel._SupplierIDs.Count > 0)
            {
                where = where.And(x => x.SupplierID.HasValue && filterModel._SupplierIDs.Contains(x.SupplierID.Value));
            }
            if (filterModel._NotSupplierIDs.IsNotEmpty() && filterModel._NotSupplierIDs.Count > 0)
            {
                where = where.And(x => x.SupplierID.HasValue && !filterModel._NotSupplierIDs.Contains(x.SupplierID.Value));
            }

            //供应商名称
            if (!string.IsNullOrEmpty(filterModel._SupplierName))
            {
                where = where.And(x => x.SupplierName.Contains(filterModel._SupplierName));
            }
            if (!string.IsNullOrEmpty(filterModel._SupplierNameEqual))
            {
                where = where.And(x => x.SupplierName == filterModel._SupplierNameEqual);
            }

            //制造商
            if (filterModel._ProducerID.HasValue)
            {
                where = where.And(x => x.ProducerID == filterModel._ProducerID.Value);
            }
            if (filterModel._ProducerIDs.IsNotEmpty() && filterModel._ProducerIDs.Count > 0)
            {
                where = where.And(x => x.ProducerID.HasValue && filterModel._ProducerIDs.Contains(x.ProducerID.Value));
            }
            if (filterModel._NotProducerIDs.IsNotEmpty() && filterModel._NotProducerIDs.Count > 0)
            {
                where = where.And(x => x.ProducerID.HasValue && !filterModel._NotProducerIDs.Contains(x.ProducerID.Value));
            }

            //制造商名称
            if (!string.IsNullOrEmpty(filterModel._ProducerName))
            {
                where = where.And(x => x.ProducerName.Contains(filterModel._ProducerName));
            }
            if (!string.IsNullOrEmpty(filterModel._ProducerNameEqual))
            {
                where = where.And(x => x.ProducerName == filterModel._ProducerNameEqual);
            }

            //矿山
            if (filterModel._DepartmentID.HasValue)
            {
                where = where.And(x => x.DepartmentID == filterModel._DepartmentID.Value);
            }
            if (filterModel._DepartmentIDs.IsNotEmpty() && filterModel._DepartmentIDs.Count > 0)
            {
                where = where.And(x => filterModel._DepartmentIDs.Contains(x.DepartmentID));
            }
            if (filterModel._NotDepartmentIDs.IsNotEmpty() && filterModel._NotDepartmentIDs.Count > 0)
            {
                where = where.And(x => !filterModel._NotDepartmentIDs.Contains(x.DepartmentID));
            }

            //提升机类型
            if (filterModel._HoisterID.HasValue)
            {
                where = where.And(x => x.HoisterID == filterModel._HoisterID.Value);
            }
            if (filterModel._HoisterIDs.IsNotEmpty() && filterModel._HoisterIDs.Count > 0)
            {
                where = where.And(x => filterModel._HoisterIDs.Contains(x.HoisterID));
            }
            if (filterModel._NotHoisterIDs.IsNotEmpty() && filterModel._NotHoisterIDs.Count > 0)
            {
                where = where.And(x => !filterModel._NotHoisterIDs.Contains(x.HoisterID));
            }

            //提升机类型名称
            if (!string.IsNullOrEmpty(filterModel._HoisterName))
            {
                where = where.And(x => x.HoisterName.Contains(filterModel._HoisterName));
            }
            if (!string.IsNullOrEmpty(filterModel._HoisterNameEqual))
            {
                where = where.And(x => x.HoisterName == filterModel._HoisterNameEqual);
            }

            //提升机用途
            if (filterModel._HoisterUsageID.HasValue)
            {
                where = where.And(x => x.HoisterUsageID == filterModel._HoisterUsageID.Value);
            }
            if (filterModel._HoisterUsageIDs.IsNotEmpty() && filterModel._HoisterUsageIDs.Count > 0)
            {
                where = where.And(x => filterModel._HoisterUsageIDs.Contains(x.HoisterUsageID));
            }
            if (filterModel._NotHoisterUsageIDs.IsNotEmpty() && filterModel._NotHoisterUsageIDs.Count > 0)
            {
                where = where.And(x => !filterModel._NotHoisterUsageIDs.Contains(x.HoisterUsageID));
            }

            //提升机用途名称
            if (!string.IsNullOrEmpty(filterModel._HoisterUsageName))
            {
                where = where.And(x => x.HoisterUsageName.Contains(filterModel._HoisterUsageName));
            }
            if (!string.IsNullOrEmpty(filterModel._HoisterUsageNameEqual))
            {
                where = where.And(x => x.HoisterUsageName == filterModel._HoisterUsageNameEqual);
            }

            //钢丝绳类型
            if (filterModel._WireropeTypeID.HasValue)
            {
                where = where.And(x => x.WireropeTypeID == filterModel._WireropeTypeID.Value);
            }
            if (filterModel._WireropeTypeIDs.IsNotEmpty() && filterModel._WireropeTypeIDs.Count > 0)
            {
                where = where.And(x => filterModel._WireropeTypeIDs.Contains(x.WireropeTypeID));
            }
            if (filterModel._NotWireropeTypeIDs.IsNotEmpty() && filterModel._NotWireropeTypeIDs.Count > 0)
            {
                where = where.And(x => !filterModel._NotWireropeTypeIDs.Contains(x.WireropeTypeID));
            }

            //钢丝绳类型名称
            if (!string.IsNullOrEmpty(filterModel._WireropeTypeName))
            {
                where = where.And(x => x.WireropeTypeName.Contains(filterModel._WireropeTypeName));
            }
            if (!string.IsNullOrEmpty(filterModel._WireropeTypeNameEqual))
            {
                where = where.And(x => x.WireropeTypeName == filterModel._WireropeTypeNameEqual);
            }

            //安装日期
            if (filterModel._InstallDate.HasValue)
            {
                where = where.And(x => x.InstallDate == filterModel._InstallDate.Value);
            }
            if (filterModel._InstallDate_Begin.HasValue)
            {
                where = where.And(x => x.InstallDate >= filterModel._InstallDate_Begin.Value);
            }
            if (filterModel._InstallDate_End.HasValue)
            {
                where = where.And(x => x.InstallDate < filterModel._InstallDate_End.Value.AddDays(1));
            }

            //安装地点
            if (filterModel._InstallAddressID.HasValue)
            {
                where = where.And(x => x.InstallAddressID == filterModel._InstallAddressID.Value);
            }
            if (filterModel._InstallAddressIDs.IsNotEmpty() && filterModel._InstallAddressIDs.Count > 0)
            {
                where = where.And(x => filterModel._InstallAddressIDs.Contains(x.InstallAddressID));
            }
            if (filterModel._NotInstallAddressIDs.IsNotEmpty() && filterModel._NotInstallAddressIDs.Count > 0)
            {
                where = where.And(x => !filterModel._NotInstallAddressIDs.Contains(x.InstallAddressID));
            }

            //安装地点名称
            if (!string.IsNullOrEmpty(filterModel._InstallAddressName))
            {
                where = where.And(x => x.InstallAddressName.Contains(filterModel._InstallAddressName));
            }
            if (!string.IsNullOrEmpty(filterModel._InstallAddressNameEqual))
            {
                where = where.And(x => x.InstallAddressName == filterModel._InstallAddressNameEqual);
            }

            //出库日期
            if (filterModel._OutStockDate.HasValue)
            {
                where = where.And(x => x.OutStockDate == filterModel._OutStockDate.Value);
            }
            if (filterModel._OutStockDate_Begin.HasValue)
            {
                where = where.And(x => x.OutStockDate >= filterModel._OutStockDate_Begin.Value);
            }
            if (filterModel._OutStockDate_End.HasValue)
            {
                where = where.And(x => x.OutStockDate < filterModel._OutStockDate_End.Value.AddDays(1));
            }

            //下次检测日期
            if (filterModel._NextCheckDate.HasValue)
            {
                where = where.And(x => x.NextCheckDate == filterModel._NextCheckDate.Value);
            }
            if (filterModel._NextCheckDate_Begin.HasValue)
            {
                where = where.And(x => x.NextCheckDate >= filterModel._NextCheckDate_Begin.Value);
            }
            if (filterModel._NextCheckDate_End.HasValue)
            {
                where = where.And(x => x.NextCheckDate < filterModel._NextCheckDate_End.Value.AddDays(1));
            }

            //状态
            if (filterModel._Status.HasValue)
            {
                where = where.And(x => x.Status == filterModel._Status.Value);
            }
            if (filterModel._Statuss.IsNotEmpty() && filterModel._Statuss.Count > 0)
            {
                where = where.And(x => filterModel._Statuss.Contains(x.Status));
            }
            if (filterModel._NotStatuss.IsNotEmpty() && filterModel._NotStatuss.Count > 0)
            {
                where = where.And(x => !filterModel._NotStatuss.Contains(x.Status));
            }

            //换绳日期
            if (filterModel._ChangeDate.HasValue)
            {
                where = where.And(x => x.ChangeDate == filterModel._ChangeDate.Value);
            }
            if (filterModel._ChangeDate_Begin.HasValue)
            {
                where = where.And(x => x.ChangeDate >= filterModel._ChangeDate_Begin.Value);
            }
            if (filterModel._ChangeDate_End.HasValue)
            {
                where = where.And(x => x.ChangeDate < filterModel._ChangeDate_End.Value.AddDays(1));
            }

            //创建人姓名
            if (!string.IsNullOrEmpty(filterModel._CreateUserName))
            {
                where = where.And(x => x.CreateUserName.Contains(filterModel._CreateUserName));
            }
            if (!string.IsNullOrEmpty(filterModel._CreateUserNameEqual))
            {
                where = where.And(x => x.CreateUserName == filterModel._CreateUserNameEqual);
            }

            //创建时间
            if (filterModel._CreateDate.HasValue)
            {
                where = where.And(x => x.CreateDate == filterModel._CreateDate.Value);
            }
            if (filterModel._CreateDate_Begin.HasValue)
            {
                where = where.And(x => x.CreateDate >= filterModel._CreateDate_Begin.Value);
            }
            if (filterModel._CreateDate_End.HasValue)
            {
                where = where.And(x => x.CreateDate < filterModel._CreateDate_End.Value.AddDays(1));
            }

            //修改人姓名
            if (!string.IsNullOrEmpty(filterModel._UpdateUserName))
            {
                where = where.And(x => x.UpdateUserName.Contains(filterModel._UpdateUserName));
            }
            if (!string.IsNullOrEmpty(filterModel._UpdateUserNameEqual))
            {
                where = where.And(x => x.UpdateUserName == filterModel._UpdateUserNameEqual);
            }

            //修改时间
            if (filterModel._UpdateDate.HasValue)
            {
                where = where.And(x => x.UpdateDate == filterModel._UpdateDate.Value);
            }
            if (filterModel._UpdateDate_Begin.HasValue)
            {
                where = where.And(x => x.UpdateDate >= filterModel._UpdateDate_Begin.Value);
            }
            if (filterModel._UpdateDate_End.HasValue)
            {
                where = where.And(x => x.UpdateDate < filterModel._UpdateDate_End.Value.AddDays(1));
            }

            return where;
        }
        #endregion
    }
}

